package com.vecspace.msoffice;

/**excel的合并单元格
 * 
 * @version: 1.0
 * @author: wanghua
 */
public class MergeRegion {
	private int startRow;//合并单元格的第一个cell
	private int endRow;
	private int startCol;//合并单元格的最后一个cell
	private int endCol;
	
	private Object cellValue;

	public MergeRegion() {
		
	}
	
	/**
	 * 
	 * @param startRow
	 * @param endRow
	 * @param startCol
	 * @param endCol
	 */
	public MergeRegion(int startRow, int endRow, int startCol, int endCol) {
		this.startRow = startRow;
		this.endRow = endRow;
		this.startCol = startCol;
		this.endCol = endCol;
	}
	/**本合并单元格，是否包含指定的cell
	 * 
	 * @param row
	 * @param col
	 * @return 
	 * @author: wanghua
	 */
	public boolean contains(int row, int col) {
		boolean result = row >= startRow &&  row <= endRow
				&& col >= startCol && col <= endCol;
		return result;
	}
	
	public int getStartRow() {
		return startRow;
	}

	public void setStartRow(int startRow) {
		this.startRow = startRow;
	}

	public int getEndRow() {
		return endRow;
	}

	public void setEndRow(int endRow) {
		this.endRow = endRow;
	}

	public int getStartCol() {
		return startCol;
	}

	public void setStartCol(int startCol) {
		this.startCol = startCol;
	}

	public int getEndCol() {
		return endCol;
	}

	public void setEndCol(int endCol) {
		this.endCol = endCol;
	}

	public Object getCellValue() {
		return cellValue;
	}

	public void setCellValue(Object cellValue) {
		this.cellValue = cellValue;
	}
	
}
